import request from '@/utils/request'
// -------- 咨询方式 --------

let BASE_ADDRESS = 'work/commercialManager'

//  商务经理
export function getCommercialManagerApi(params) {
    return request({
        url: `${BASE_ADDRESS}/list`,
        method: "get",
        params
    })
}

//  商务列表 /work/commercialManager/cmList
export function getCommercialManagerCmListApi(params) {
    return request({
        url: `${BASE_ADDRESS}/cmList`,
        method: "get",
        params
    })
}

//  添加渠道专员和商务专员
export function getCommercialManageraddApi(data) {
    //console.log(data)
    return request({
        url: `${BASE_ADDRESS}/add`,
        method: "POST",
        data
    })
}

//  添加渠道专员和商务专员
export function getCommercialManagerEditApi(data) {
    return request({
        url: `${BASE_ADDRESS}/edit`,
        method: "PUT",
        data
    })
}


//查询所有渠道
export const getcommercialManagerplaceListApi = (params) => {
    return request({
        url: `${BASE_ADDRESS}/placeList`,
        method: 'get',
        params
    })
}

//查询所有渠道（新） /work/commercialManager/placeListAll
export const getcommercialManagerplaceListAllApi = (params) => {
    //console.log(params)
    console.log(`${BASE_ADDRESS}/placeListAll`)
    return request({
        url: `${BASE_ADDRESS}/placeListAll`,
        method: 'get',
        params
    })
}


// 查询用户(渠道)
export const getcommercialManagerPlaceOfUserApi = (params) => {
    return request({
        url: `${BASE_ADDRESS}/placeOfUser`,
        method: 'GET',
        params
    })
}


//邀请用户
export const getcommercialManagerInviteJoinApi = (params) => {
    // console.log(params);
    return request({
        url: `${BASE_ADDRESS}/inviteJoin/${params?.phone}/${params?.type}`,
        method: 'POST',

    })
}

// 获取商务和渠道id
export const getCommercialManagerObtainApi = () => {
    return request({
        url: `/work/commercialManager/obtain`,
        method: 'get',
    })
}